import request from '@/utils/request'

// 订单列表
export async function sorderPage(params) {
    try {
        const res = await request({
            url: '/sorder/sorderPage',
            method: 'post',
            params
        })
        return res
    } catch (error) {
        return null
    }
}

// 添加订单
export async function OrderAdd(data) {
    try {
        const res = await request({
            url: '/sorder/OrderAdd',
            method: 'post',
            data
        })
        return res
    } catch (error) {
        return null
    }
}

// 订单审核
export async function sorder_SetState(params) {
    try {
        const res = await request({
            url: '/sorder/sorder_SetState',
            method: 'post',
            params
        })
        return res
    } catch (error) {
        return null
    }
}

// 订单详情
export async function SoFirst(params) {
    try {
        const res = await request({
            url: '/sorder/SoFirst',
            method: 'post',
            params
        })
        return res
    } catch (error) {
        return null
    }
}

// 订单列表 导出Excel
export async function sorderExcel(params) {
    const res = await request({
        url: "/sorder/sorderExcel",
        method: "post",
        params,
        responseType: "blob",
    });
    return res;
}

// 订单日统计
export async function GetDayPageView(params) {
    try {
        const res = await request({
            url: '/sorder/GetDayPageView',
            method: 'post',
            params
        })
        return res
    } catch (error) {
        return null
    }
}